#include <buola/net/cxmlrpcreply.h>
#include <buola/io.h>

namespace buola { namespace io {

CXMLRPCReply::CXMLRPCReply(const std::string &pReply)
{
    mXML.Parse(pReply);
    
    mValue=mXML.Root().FirstChild("params").FirstChild("param").FirstChild("value").FirstChild();
    msg_info() << mValue.Name() << "\n";
}

void CXMLRPCReply::GetValue(CXMLRPCStruct &pValue)
{
    if(!mValue.MatchesName("struct"))
        throw XInvalid("mismatched type in XML-RPC reply");
    
    pValue=CXMLRPCStruct(mValue);
}

/*namespace io*/ } /*namespace buola*/ }
